home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / incoming / jstools-.6v3 / jstools- / jstools-tk3.6v3.0 / lib / jhelp / jbindings.tcl.jhelp next >
Encoding:
Text File  |  1995-02-05  |  21.5 KB  |  318 lines

  1. qsection Introduction {{The jbindings.tcl library is distributed as part of the jstools package.  It consists of a number of procedures used by the jbrowser, jedit, jhelp, jmore, jpeople, and jprefs applications.  It contains high¡level procedures to set basic and Emacs¡style keyboard bindings for entry and text widgets, as well as the underlying procedures that implement the bindings.
  2.  
  3. This help file describes jbindings.tcl version 3.6/2.0.
  4.  
  5. Note: This help file is not finished.
  6. }} {{{sel {}} {hilight {}} {xref-topic {1.124 1.132 1.134 1.139 1.141 1.146 1.148 1.153 1.155 1.162 1.168 1.174}} {xref-section {}} {j:rt:rm {}} {j:rt:it {}} {j:rt:bf {1.4 1.17 1.56 1.63 3.25 3.38 5.0 6.0}} {j:rt:bi {}} {j:rt:tt {1.124 1.132 1.134 1.139 1.141 1.146 1.148 1.153 1.155 1.162 1.169 1.174}} {j:rt:hl {}} {TOPIC:browser.tk {1.124 1.132}} {TOPIC:edit.tk {1.136 1.139}} {TOPIC:help.tk {1.144 1.146}} {TOPIC:more.tk {1.150 1.153}} {TOPIC:people.tk {1.158 1.162}} {TOPIC:prefs.tk {1.169 1.174}} {TOPIC:jedit {1.134 1.139}} {TOPIC:jhelp {1.141 1.146}} {TOPIC:jmore {1.148 1.153}} {TOPIC:jpeople {1.155 1.162}} {TOPIC:jprefs {1.168 1.174}} {TOPIC:jlibrary.tcl {}} {{SECTION:Procedures to Set Bindings} {}} {{SECTION:Basic Bindings} {}} {{SECTION:Emacs Bindings} {}} {{SECTION:Publically¡Useful Text Procedures} {}}} {{del_from 6.0} {abbrevstart 1.0} {matchend 3.0} {insert 1.0} {del_to 6.0} {anchor 5.37} {matchstart 3.0} {current 6.0}}}
  7.  
  8. qsection Usage {{Accessing the Library
  9. The standard way to use jbindings.tcl is to install it in the Tk library directory (normally /usr/local/lib/tk) and run the auto_mkindex Tcl procedure with appropriate arguments on that directory.  You might do this by typing
  10.  
  11.     localhost% wish
  12.     wish> auto_mkindex $tk_library "*.tcl"
  13.     wish> exit
  14.  
  15. This lets Tcl automatically find and use procedures from the library when they're called.
  16.  
  17. However, the jstools applications also allow this library to reside in an individual user's ~/.tk directory.  If it's found there, it's sourced when the application first starts running.  This lets people who don't have write access to $tk_library at their site install applications using the library for their personal use, and (possibly more importantly) lets them customise the library procedures to their liking.
  18.  
  19. I strongly suggest that other developers using jbindings.tcl duplicate this behaviour in their applications, using code like the following:
  20.  
  21.     global env
  22.     if {[file isfile "$env(HOME)/.tk/jbindings.tcl"]} then {
  23.       source "$env(HOME)/.tk/jbindings.tcl"
  24.     }
  25.  
  26. If you've already sourced or auto¡loaded the jlibrary.tcl library, then you can just say
  27.  
  28.     j:source_config jbindings.tcl
  29.  
  30. instead.
  31.  
  32. Setting Bindings
  33. Typically, you would then use a variant on the following code to set up class bindings for text and entry widgets:
  34.  
  35.     switch -exact $PREFS(bindings) {
  36.       basic {
  37.         j:eb:basic_bind Entry
  38.         j:tb:basic_bind Text
  39.       }
  40.       emacs {
  41.         j:eb:emacs_bind Entry
  42.         j:tb:emacs_bind Text
  43.         # additional application-specific Emacs-style bindings  
  44.         bind Text <Control-x><Control-s>    {cmd_save}
  45.         bind Text <Control-x><Control-f>    {cmd_load}
  46.         bind Text <Control-x><Control-c>    {cmd_quit}
  47.       }
  48.     }
  49.  
  50. This assumes that the PREFS(bindings) variable has been appropriately set; you can use j:global_pref_panel and j:read_standard_prefs, both in the jlibrary.tcl library, to allow the user to choose bindings.  Note also that you may want to set your own additional application¡specific keyboard bindings depending on the user's preferred keyboard bindings.
  51.  
  52. A future version of the library will support vi bindings as well.
  53. }} {{{sel {}} {hilight {}} {xref-topic {19.45 19.57 43.146 43.158}} {xref-section {}} {j:rt:rm {}} {j:rt:it {}} {j:rt:bf {2.24 2.37 2.93 2.110 10.13 10.20 10.92 10.97 12.47 12.60 19.45 19.57 43.146 43.158}} {j:rt:bi {}} {j:rt:tt {2.124 2.136 4.0 7.0 10.236 10.247 14.0 19.0 21.0 22.0 28.0 42.0 43.22 43.37 43.87 43.106 43.111 43.132 45.45 45.47}} {j:rt:hl {1.0 2.0 25.0 26.0}} {TOPIC:browser.tk {}} {TOPIC:edit.tk {}} {TOPIC:help.tk {}} {TOPIC:more.tk {}} {TOPIC:people.tk {}} {TOPIC:prefs.tk {}} {TOPIC:jedit {}} {TOPIC:jhelp {}} {TOPIC:jmore {}} {TOPIC:jpeople {}} {TOPIC:jprefs {}} {TOPIC:jlibrary.tcl {19.45 19.57 43.146 43.158}} {{SECTION:Procedures to Set Bindings} {}} {{SECTION:Basic Bindings} {}} {{SECTION:Emacs Bindings} {}} {{SECTION:Publically¡Useful Text Procedures} {}}} {{del_from 46.0} {abbrevstart 25.0} {matchend 16.35} {insert 1.0} {del_to 46.0} {anchor 25.16} {matchstart 16.26} {current 1.0}}}
  54.  
  55. qsection {Credits and Copyright} {{Author
  56. Jay Sekora 
  57. js@it.bu.edu
  58. http://www.bu.edu/DSG/js/home.html
  59.  
  60. Other Contributors
  61. Some of the code in the library comes from other sources.  Some code is based on code from the standard Tk library from the Tk distribution.  Other people whose code appears in the library include R. James Noble <kjx@comp.vuw.ac.nz> Paul E. Raines <raines@cgibm1.slac.stanford.edu>, and Tom Phelps <phelps@ginkgo.cs.berkeley.edu>.
  62.  
  63. Copyright
  64. The library is copyright ⌐ 1992-1994 by Jay Sekora, but may be freely copied and modified for non¡commercial purposes.  (Please contact me if you want to use it for a commercial purpose, this may be OK under some circumstances.)}} {{{sel {}} {hilight {}} {xref-topic {}} {xref-section {}} {j:rt:rm {}} {j:rt:it {}} {j:rt:bf {}} {j:rt:bi {}} {j:rt:tt {3.0 4.34 7.213 7.231 7.249 7.280 7.299 7.328}} {j:rt:hl {1.0 2.0 6.0 7.0 9.0 10.0}} {TOPIC:browser.tk {}} {TOPIC:edit.tk {}} {TOPIC:help.tk {}} {TOPIC:more.tk {}} {TOPIC:people.tk {}} {TOPIC:prefs.tk {}} {TOPIC:jedit {}} {TOPIC:jhelp {}} {TOPIC:jmore {}} {TOPIC:jpeople {}} {TOPIC:jprefs {}} {TOPIC:jlibrary.tcl {}} {{SECTION:Procedures to Set Bindings} {}} {{SECTION:Basic Bindings} {}} {{SECTION:Emacs Bindings} {}} {{SECTION:Publically¡Useful Text Procedures} {}}} {{del_from 10.228} {abbrevstart 7.330} {matchend 10.228} {insert 1.0} {del_to 10.228} {anchor 7.326} {matchstart 10.228} {current 1.6}}}
  65.  
  66. qsection Overview {{Basic Bindings
  67.  
  68. Emacs Bindings
  69.  
  70. Procedures to Set Bindings
  71. j:eb:basic_bind Entry        set up basic bindings for entry widgets
  72. j:eb:emacs_bind Entry        set up Emacs bindings for entry widgets
  73. j:tb:basic_bind Text        set up basic bindings for text widgets
  74. j:tb:emacs_bind Text        set up Emacs bindings for text widgets
  75.  
  76. Publically¡Useful Text Procedures
  77. j:tb:mark_dirty        mark text widget as dirty (modified)
  78. j:tb:mark_clean        mark text widget as clean (unmodified)
  79. j:tb:is_dirty          return 1 if text widget is dirty (modified) else 0
  80.  
  81. Note: This help file is not finished.
  82. }} {{{sel {}} {hilight {}} {xref-topic {}} {xref-section {1.0 1.14 3.0 3.14 5.0 5.26 11.0 11.33}} {j:rt:rm {}} {j:rt:it {}} {j:rt:bf {16.0 17.0}} {j:rt:bi {}} {j:rt:tt {6.0 6.23 7.0 7.23 8.0 8.22 9.0 9.22 12.0 12.17 13.0 13.17 14.0 14.17}} {j:rt:hl {1.0 1.14 3.0 3.14 5.0 5.26 11.0 12.0}} {TOPIC:browser.tk {}} {TOPIC:edit.tk {}} {TOPIC:help.tk {}} {TOPIC:more.tk {}} {TOPIC:people.tk {}} {TOPIC:prefs.tk {}} {TOPIC:jedit {}} {TOPIC:jhelp {}} {TOPIC:jmore {}} {TOPIC:jpeople {}} {TOPIC:jprefs {}} {TOPIC:jlibrary.tcl {}} {{SECTION:Procedures to Set Bindings} {5.0 5.26}} {{SECTION:Basic Bindings} {1.0 1.14}} {{SECTION:Emacs Bindings} {3.0 3.14}} {{SECTION:Publically¡Useful Text Procedures} {11.0 11.33}}} {{del_from 17.0} {abbrevstart 16.6} {matchend 17.0} {insert 1.0} {del_to 17.0} {anchor 16.37} {matchstart 17.0} {current 1.0}}}
  83.  
  84. qsection {Basic Bindings} {{Text Bindings
  85. The following text bindings are set up by the statement `j:tb:basic_bind Text':
  86.  
  87. The arrow keys move one character or one line up, down, left or right.  The concept of `line' used is that of the text widget (and of Emacs), so a long line that is wrapped in the text widget counts as one line.  Also, lines with tabs in them are not currently treated properly.
  88.  
  89. Home        moves to the beginning of the line
  90. End        moves to the end of the line
  91.  
  92. Next        scrolls down one screenful.  (Next is often labelled PageDown)
  93.         This requires that the widget be linked to a scrollbar.
  94. Prior        scrolls up one screenful.  (Prior is often labelled PageUp)
  95.         This requires that the widget be linked to a scrollbar.
  96.  
  97. Control-i    inserts a tab
  98. Control-j    inserts a newline
  99. Return        inserts a newline
  100.  
  101. Control-h    deletes one character backwards
  102. Delete        deletes one character backwards
  103. BackSpace    deletes one character backwards
  104.  
  105. Any other key    inserts its ASCII representation
  106.  
  107. Dragging the mouse past the top or bottom edge of the widget with Button 1 will automatically scroll the widget as it extends the selection.  (Thanks to Paul E. Raines <raines@cgibm1.slac.stanford.edu> for code to implement this.)
  108.  
  109. Dragging the mouse up or down with Button 2 will cause the text widget to scroll, but clicking (quickly) with Button 2 will paste the current X selection.  (Thanks to Tom Phelps <phelps@cs.berkeley.edu> for code to implement this.)
  110.  
  111. Entry Bindings
  112. The following entry bindings are set up by the statement `j:eb:basic_bind Entry':
  113.  
  114. The left and right arrow keys move one character left or right.
  115.  
  116. Home        moves to the beginning of the line
  117. End        moves to the end of the line
  118.  
  119. Control-i    inserts a tab
  120. Control-j    inserts a newline
  121. Return        inserts a newline
  122.  
  123. Control-v    pastes the current selection
  124.  
  125. Control-h    deletes one character backwards
  126. Delete        deletes one character backwards
  127. BackSpace    deletes one character backwards
  128.  
  129. Any other key    inserts its ASCII representation
  130.  
  131. Double¡clicking    selects a word
  132. Triple¡clicking    selects the entire entry
  133.  
  134. Dragging the mouse left or right with Button 2 will cause the entry widget to scroll, but clicking (quickly) with Button 2 will paste the current X selection.  (Thanks to Tom Phelps <phelps@cs.berkeley.edu> for code to implement this.)
  135. }} {{{sel {}} {hilight {}} {xref-topic {}} {xref-section {}} {j:rt:rm {}} {j:rt:it {22.13 22.14 46.13 46.14 48.15 48.16 49.15 49.16}} {j:rt:bf {6.0 6.4 7.0 7.3 9.0 9.4 9.36 9.40 9.59 9.67 11.0 11.5 11.35 11.40 11.59 11.65 14.0 14.10 15.0 15.10 16.0 16.8 18.0 18.10 19.0 19.8 20.0 20.10 33.0 33.6 34.0 34.5 36.0 36.10 37.0 37.10 38.0 38.8 40.0 40.10 42.0 42.10 43.0 43.8 44.0 44.10}} {j:rt:bi {22.0 22.13 46.0 46.13 48.0 48.15 49.0 49.15}} {j:rt:tt {2.57 2.77 24.169 24.200 26.179 26.201 29.58 29.79 51.183 51.205}} {j:rt:hl {1.0 2.0 28.0 29.0}} {TOPIC:browser.tk {}} {TOPIC:edit.tk {}} {TOPIC:help.tk {}} {TOPIC:more.tk {}} {TOPIC:people.tk {}} {TOPIC:prefs.tk {}} {TOPIC:jedit {}} {TOPIC:jhelp {}} {TOPIC:jmore {}} {TOPIC:jpeople {}} {TOPIC:jprefs {}} {TOPIC:jlibrary.tcl {}} {{SECTION:Procedures to Set Bindings} {}} {{SECTION:Basic Bindings} {}} {{SECTION:Emacs Bindings} {}} {{SECTION:Publically¡Useful Text Procedures} {}}} {{del_from 52.0} {abbrevstart 51.24} {matchend 18.41} {insert 1.0} {del_to 52.0} {anchor 51.190} {matchstart 18.32} {current 30.0}}}
  136.  
  137. qsection {Emacs Bindings} {{Text Bindings
  138. The following text bindings are set up by the statement `j:tb:emacs_bind Text':
  139.  
  140. The arrow keys move one character or one line up, down, left or right.  The concept of `line' used is that of the text widget (and of Emacs), so a long line that is wrapped in the text widget counts as one line.  Also, lines with tabs in them are not currently treated properly.
  141.  
  142. Home        moves to the beginning of the line
  143. End        moves to the end of the line
  144.  
  145. Next        scrolls down one screenful.  (Next is often labelled PageDown)
  146.         This requires that the widget be linked to a scrollbar.
  147. Prior        scrolls up one screenful.  (Prior is often labelled PageUp)
  148.         This requires that the widget be linked to a scrollbar.
  149.  
  150. Control-i    inserts a tab
  151. Control-j    inserts a newline
  152. Return        inserts a newline
  153.  
  154. Control-h    deletes one character backwards
  155. Delete        deletes one character backwards
  156. BackSpace    deletes one character backwards
  157.  
  158. Control-p    moves one line up (to the previous line)
  159. Control-n    moves one line down (to the next line)
  160. Control-b    moves one character to the left (backwards)
  161. Control-f    moves one character to the right (forwards)
  162. Control-a    moves to the beginning of the line
  163. Control-e    moves to the end of the line
  164. Escape-b    moves one word left (backwards)
  165. Escape-f    moves one word right (forwards)
  166. Escape <    moves to the top of the text
  167. Escape >    moves to the end of the text
  168.  
  169. Control-v    scrolls down one screenful.
  170.         This requires that the widget be linked to a scrollbar.
  171. Escape v    scrolls up one screenful.
  172.         This requires that the widget be linked to a scrollbar.
  173.  
  174. Control-u    generally, repeats the next key or key combination four times
  175. Escape digit    starts a numeric argument (to repeat the next key sequence)
  176. Control-u digit    starts a numeric argument (to repeat the next key sequence)
  177.  
  178. Control-q char    inserts char literally, even if it's a control character
  179.         (There are some bugs in this.)
  180.  
  181. Control-d    deletes one character to the right (forwards)
  182. Escape Delete    deletes one word to the left
  183. Escape d    deletes one word to the right
  184.  
  185. Control-k    deletes (and remembers) the remainder of the line, as in Emacs
  186. Control-w    deletes and remembers the current selection
  187. Control-y    inserts text previously deleted by Control-k or Control-w
  188.  
  189. Control-@    set the Emacs `mark' (i.e., remember your current position)
  190. Control-space    set the Emacs `mark' (i.e., remember your current position)
  191. Control-x Control-x
  192.         exchange the current insert position and the `mark'
  193.         (i.e., return to where you typed Control-@ or Control-space.)
  194.         (There are some bugs in this.)
  195.  
  196. Any other key    inserts its ASCII representation
  197.  
  198. Dragging the mouse past the top or bottom edge of the widget with Button 1 will automatically scroll the widget as it extends the selection.  (Thanks to Paul E. Raines <raines@cgibm1.slac.stanford.edu> for code to implement this.)
  199.  
  200. Dragging the mouse up or down with Button 2 will cause the text widget to scroll, but clicking (quickly) with Button 2 will paste the current X selection.  (Thanks to Tom Phelps <phelps@ginkgo.cs.berkeley.edu> for code to implement this.)
  201.  
  202. Entry Bindings
  203. The following entry bindings are set up by the statement `j:eb:emacs_bind Entry':
  204.  
  205. The left and right arrow keys move one character left or right.
  206.  
  207. Home        moves to the beginning of the line
  208. End        moves to the end of the line
  209.  
  210. Control-i    inserts a tab
  211. Control-j    inserts a newline
  212. Return        inserts a newline
  213.  
  214. Control-v    pastes the current selection
  215.  
  216. Control-h    deletes one character backwards
  217. Delete        deletes one character backwards
  218. BackSpace    deletes one character backwards
  219.  
  220. Control-b    moves one character to the left (backwards)
  221. Control-f    moves one character to the right (forwards)
  222. Control-a    moves to the beginning of the line
  223. Control-e    moves to the end of the line
  224. Escape-b    moves one word left (backwards)
  225. Escape-f    moves one word right (forwards)
  226.  
  227. Control-d    deletes one character to the right (forwards)
  228. Escape Delete    deletes one word to the left
  229. Escape d    deletes one word to the right
  230.  
  231. Control-k    deletes to the end of the line
  232. Control-w    deletes the current selection
  233.  
  234. Any other key    inserts its ASCII representation
  235.  
  236. Double¡clicking    selects a word
  237. Triple¡clicking    selects the entire entry
  238.  
  239. Dragging the mouse left or right with Button 2 will cause the entry widget to scroll, but clicking (quickly) with Button 2 will paste the current X selection.  (Thanks to Tom Phelps <phelps@ginkgo.cs.berkeley.edu> for code to implement this.)
  240. }} {{{sel {}} {hilight {}} {xref-topic {}} {xref-section {}} {j:rt:rm {}} {j:rt:it {22.36 22.44 23.38 23.42 24.43 24.52 25.44 25.52 28.30 28.39 29.31 29.39 60.13 60.14 84.43 84.52 85.44 85.52 88.30 88.39 89.31 89.39 98.13 98.14 100.15 100.16 101.15 101.16}} {j:rt:bf {6.0 6.4 7.0 7.3 9.0 9.4 9.36 9.40 9.59 9.67 11.0 11.5 11.35 11.40 11.59 11.65 14.0 14.10 15.0 15.10 16.0 16.8 18.0 18.10 19.0 19.8 20.0 20.10 22.0 22.9 23.0 23.9 24.0 24.9 25.0 25.9 26.0 26.9 27.0 27.9 28.0 28.8 29.0 29.8 30.0 30.8 31.0 31.8 33.0 33.9 35.0 35.8 38.0 38.9 39.0 39.7 40.0 40.10 42.0 42.10 45.0 45.9 46.0 46.13 47.0 47.8 49.0 49.9 50.0 50.9 51.0 51.9 51.45 51.54 51.58 51.67 53.0 53.10 54.0 54.14 55.0 56.0 57.35 57.44 57.48 57.61 71.0 71.6 72.0 72.5 74.0 74.10 75.0 75.10 76.0 76.8 78.0 78.10 80.0 80.10 81.0 81.8 82.0 82.10 84.0 84.9 85.0 85.9 86.0 86.9 87.0 87.9 88.0 88.8 89.0 89.8 91.0 91.9 92.0 92.13 93.0 93.8 95.0 95.9 96.0 96.9}} {j:rt:bi {39.7 39.12 40.10 40.15 42.10 42.14 60.0 60.13 98.0 98.13 100.0 100.15 101.0 101.15}} {j:rt:tt {2.57 2.77 62.169 62.200 64.179 64.208 67.58 67.79 103.183 103.212}} {j:rt:hl {1.0 2.0 66.0 67.0}} {TOPIC:browser.tk {}} {TOPIC:edit.tk {}} {TOPIC:help.tk {}} {TOPIC:more.tk {}} {TOPIC:people.tk {}} {TOPIC:prefs.tk {}} {TOPIC:jedit {}} {TOPIC:jhelp {}} {TOPIC:jmore {}} {TOPIC:jpeople {}} {TOPIC:jprefs {}} {TOPIC:jlibrary.tcl {}} {{SECTION:Procedures to Set Bindings} {}} {{SECTION:Basic Bindings} {}} {{SECTION:Emacs Bindings} {}} {{SECTION:Publically¡Useful Text Procedures} {}}} {{del_from 104.0} {abbrevstart 57.63} {matchend 24.29} {insert 1.0} {del_to 104.0} {anchor 59.0} {matchstart 24.20} {current 32.0}}}
  241.  
  242. qsection {Procedures to Set Bindings} {{These procedures provide the most important interface between your application and the jbindings.tcl library.  They set up sets of bindings for entry and text widgets.
  243.  
  244. Obviously, you don't need to use j:eb:basic_bind or j:eb:emacs_bind if your application doesn't have any entry widgets, and you don't need to use j:tb:basic_bind or j:tb:emacs_bind if your application doesn't have any text widgets.
  245.  
  246. j:eb:basic_bind Entry        set up basic bindings for entry widgets
  247. j:eb:emacs_bind Entry        set up Emacs bindings for entry widgets
  248. j:tb:basic_bind Text        set up basic bindings for text widgets
  249. j:tb:emacs_bind Text        set up Emacs bindings for text widgets
  250.  
  251. j:eb:basic_bind
  252. Usage:
  253.     j:eb:basic_bind Entry
  254.  
  255. This procedure sets up the entry bindings described in the section Basic Bindings.  In place of Entry, you can also specify the pathname of a particular entry widget, but this use hasn't been thoroughly tested and may not be reliable.
  256.  
  257. j:tb:basic_bind
  258. Usage:
  259.     j:tb:basic_bind Text
  260.  
  261. This procedure sets up the text bindings described in the section Basic Bindings.  In place of Text, you can also specify the pathname of a particular text widget, but this use hasn't been thoroughly tested and may not be reliable.
  262.  
  263. j:eb:emacs_bind
  264. Usage:
  265.     j:eb:emacs_bind Entry
  266.  
  267. This procedure sets up the entry bindings described in the section Emacs Bindings.  In place of Entry, you can also specify the pathname of a particular entry widget, but this use hasn't been thoroughly tested and may not be reliable.
  268.  
  269. j:tb:emacs_bind
  270. Usage:
  271.     j:tb:emacs_bind Text
  272.  
  273. This procedure sets up the text bindings described in the section Emacs Bindings.  In place of Text, you can also specify the pathname of a particular text widget, but this use hasn't been thoroughly tested and may not be reliable.
  274. }} {{{sel {}} {hilight {}} {xref-topic {}} {xref-section {14.67 14.81 20.66 20.80 26.67 26.81 32.66 32.80}} {j:rt:rm {}} {j:rt:it {}} {j:rt:bf {1.87 1.100}} {j:rt:bi {14.67 14.81 20.66 20.80 26.67 26.81 32.66 32.80}} {j:rt:tt {3.33 3.48 3.52 3.67 3.146 3.161 3.165 3.180 5.0 5.23 6.0 6.23 7.0 7.22 8.0 8.22 12.0 12.22 14.96 14.101 18.0 18.21 20.95 20.99 24.0 24.22 26.96 26.101 30.0 30.21 32.95 32.99}} {j:rt:hl {10.0 11.0 16.0 17.0 22.0 23.0 28.0 29.0}} {TOPIC:browser.tk {}} {TOPIC:edit.tk {}} {TOPIC:help.tk {}} {TOPIC:more.tk {}} {TOPIC:people.tk {}} {TOPIC:prefs.tk {}} {TOPIC:jedit {}} {TOPIC:jhelp {}} {TOPIC:jmore {}} {TOPIC:jpeople {}} {TOPIC:jprefs {}} {TOPIC:jlibrary.tcl {}} {{SECTION:Procedures to Set Bindings} {}} {{SECTION:Basic Bindings} {14.67 14.81 20.66 20.80}} {{SECTION:Emacs Bindings} {26.67 26.81 32.66 32.80}} {{SECTION:Publically¡Useful Text Procedures} {}}} {{del_from 33.0} {abbrevstart 33.0} {matchend 17.5} {insert 1.0} {del_to 33.0} {anchor 8.22} {matchstart 17.0} {current 1.0}}}
  275.  
  276. qsection {Publically¡Useful Text Procedures} {{These three procedures are used to mark the contents of a text widget as dirty (changed) or clean.  In general, you will mark a text widget dirty whenever you change its contents, and clean when you save it; i.e., a text widget is dirty if it needs to be saved.  All the jbindings.tcl procedures (and bindings) that alter a text widget mark it as dirty.
  277.  
  278. j:tb:mark_dirty        mark text widget as dirty (modified)
  279. j:tb:mark_clean        mark text widget as clean (unmodified)
  280. j:tb:is_dirty          return 1 if text widget is dirty (modified) else 0
  281.  
  282. j:tb:mark_dirty
  283. Usage:
  284.     j:tb:mark_dirty w
  285. Arguments:
  286.     w is the widget to mark dirty
  287.  
  288. This procedure marks text widget w as dirty.  This information can later be retrieved with j:tb:is_dirty.
  289.  
  290. j:tb:mark_clean
  291. Usage:
  292.     j:tb:mark_clean w
  293. Arguments:
  294.     w is the widget to mark clean
  295. Example:
  296.     set file [open $filename w]
  297.     puts $file [.text get 1.0 end]
  298.     close $file
  299.     j:tb:mark_clean .text
  300.  
  301. This procedure marks text widget w as clean.  This information can later be retrieved with j:tb:is_dirty.
  302.  
  303. j:tb:is_dirty
  304. Usage:
  305.     j:tb:is_dirty w
  306. Arguments:
  307.     w is the widget whose state you want to query
  308. Example:
  309.     if [j:tb:is_dirty .main.t] {
  310.       if [j:confirm -text "Really quit without saving?"] {
  311.         exit 0
  312.       }
  313.     }
  314.  
  315. This procedure returns true (1) if widget w is currently marked dirty and false (0) otherwise.  (It also returns false if w isn't a text widget whose bindings have been set up with j:tb:basic_bind or j:tb:emacs_bind.)
  316. }} {{{sel {}} {hilight {}} {xref-topic {}} {xref-section {}} {j:rt:rm {}} {j:rt:it {1.73 1.78 1.92 1.97 9.17 9.18 11.1 11.2 13.33 13.34 17.17 17.18 19.1 19.2 26.33 26.34 26.91 26.104 30.15 30.16 32.1 32.2 40.42 40.43}} {j:rt:bf {1.271 1.284}} {j:rt:bi {}} {j:rt:tt {3.0 3.17 4.0 4.17 5.0 5.17 9.0 9.17 13.91 13.104 17.0 17.17 21.0 25.0 30.0 30.15 34.0 39.0 40.29 40.30 40.81 40.82 40.181 40.196 40.201 40.215}} {j:rt:hl {7.0 8.0 15.0 16.0 28.0 29.0}} {TOPIC:browser.tk {}} {TOPIC:edit.tk {}} {TOPIC:help.tk {}} {TOPIC:more.tk {}} {TOPIC:people.tk {}} {TOPIC:prefs.tk {}} {TOPIC:jedit {}} {TOPIC:jhelp {}} {TOPIC:jmore {}} {TOPIC:jpeople {}} {TOPIC:jprefs {}} {TOPIC:jlibrary.tcl {}} {{SECTION:Procedures to Set Bindings} {}} {{SECTION:Basic Bindings} {}} {{SECTION:Emacs Bindings} {}} {{SECTION:Publically¡Useful Text Procedures} {}}} {{del_from 41.0} {abbrevstart 5.15} {matchend 1.22} {insert 1.0} {del_to 41.0} {anchor 5.15} {matchstart 1.12} {current 1.0}}}
  317.  
  318.